package com.example.music.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.music.dao.CmtUpMapper;
import com.example.music.entity.CmtUp;
import com.example.music.service.CmtUpService;
import com.example.music.utils.AjaxJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CmtUpServiceImpl extends BaseServiceImpl<CmtUp, CmtUpMapper> implements CmtUpService {
    @Autowired
    CmtUpMapper cmtUpMapper;

    @Override
    protected CmtUpMapper getMapper() {
        return cmtUpMapper;
    }

    @Override
    public Integer getAllById(Integer id) {
        QueryWrapper<CmtUp> cmtUpQueryWrapper = new QueryWrapper<>();
        QueryWrapper<CmtUp> eq = cmtUpQueryWrapper.eq("commit_id", id);
        List<CmtUp> cmtUps = cmtUpMapper.selectList(eq);
        return cmtUps.size();
    }
}
